home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / BDOS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  379 b   |  13 lines

  1. /*bdos.c --- p 552 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4.                 /* DOS function to read from keyboard */
  5. #define DOS_KBDIN 1
  6. main()
  7. {
  8.     unsigned int ch_read;
  9.         /* Nothing needs to be specified for DX and AL. Use 0's
  10.      * Also, zero out the high-order byte by bitwise AND with FFh */
  11.     ch_read = bdos(DOS_KBDIN, 0, 0) & 0xff;
  12.     printf("\nCharacter read = %c\n", ch_read);
  13. }